fixing formula function if not show right data

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
1,429
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
hello i need fixing formula or alternative it gives my the result in image2 to in column e not right it supposes some data gives me booking but all of them not booking
so the image 1 sheet's name Room Reservation and sheet's name image 2 available so if col c ,d = col j,k in sheet Room Reservation in image 1 then the result in col e booking in sheet available else no booking
VBA Code:
=IF(OR(C26="";D26="");"";IF(AND('Room Reservation'!$K$2:$K$6000=$C26;'Room Reservation'!$J$2:$J$6000=$D26);"booking";"no booking "))

2.JPG




1.JPG
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
How about
=IF(OR(C26="";D26="");"";IF(AND(isnumber(match($C26;'Room Reservation'!$K$2:$K$6000;0));isnumber(match($D26;'Room Reservation'!$J$2:$J$6000;0)));"booking";"no booking "))
 
Upvote 0
hi, fluff

this is what i got
1.JPG



the right result it supposes this
2.JPG
 
Upvote 0
In that case please post your data using the XL2BB add-in, images are useless.
 
Upvote 0
image1
Hotel Reservation Daily000 .xlsm
ABCDEFGHIJK
1Booking NoGuest NameGuest PhoneGuest CountryGuest IDCheck InCheck OutAdult GuestsChildren GuestsRoom TypeRoom No
21MAIRAJ29038423India12-Jun-2015-Jun-2011Standard102
32MARYAM2348203Pakistan12-Jun-2015-Jun-2020Standard108
43Shanza Waseem239423USA12-Jun-2015-Jun-2021Superior125
54Adeeba Kanwal2342432England12-Jun-2015-Jun-2011Superior120
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Room Reservation
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:K1000Expression=AND($B2<>"";$G2<TODAY())textYES
A2:K1000Expression=AND($B2<>"";$F2<TODAY();$G2>TODAY())textYES



image to
Hotel Reservation Daily000 .xlsm
ABCDEF
5Room NoRoom TypeStatus
6101Standard
7102Standard
8103Standard
9104Standard
10105Standard
11106Standard
12107Standard
13108Standard
14109Standard
15110Standard
16111Superior
17112Superior
18113Superior
19114Superior
20115Superior
21116Superior
22117Superior
23118Superior
24119Superior
25120Superior
26121Superior
27122Superior
28123Superior
29124Superior
30125Superior
31126Superior 
32127Superior 
33128Superior 
34129Superior 
35130Superior 
36 
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Available
Cell Formulas
RangeFormula
C11:C35,C7:C9C7=+C6+1
E31:E36E31=IF(OR(C51="",D51=""),"",IF(AND(ISNUMBER(MATCH($C51,'Room Reservation'!$K$2:$K$6000,0)),ISNUMBER(MATCH($D51,'Room Reservation'!$J$2:$J$6000,0))),"booking","no booking "))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C6:D1004Expression=AND($B6<>"";$F6<TODAY())textYES
C6:D1004Expression=AND($B6<>"";$E6<TODAY();$F6>TODAY())textYES
 
Upvote 0
You're formula in E31 is looking at C & D on row 51, it should be looking at the same row (ie 31)
 
Upvote 0
Solution
now i understood why always the members ask insert the image by xl2bb it shows the ranges what use by formulas thanks for your correcting me it works
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
hi, fluff

i found missing something in my formula an i'm sorry about it in the beginning i thought issue a new post , but i'm afraid delete it because the same data that's why i comment in this post again so i have problem in image 1 in col g this date is linked with date (today) after date(today) it should be not booking but in my formula stays booking after date(today)
 
Upvote 0
How about
=IF(OR(C6="",D6=""),"",IF(COUNTIFS('Room Reservation'!$K$2:$K$6000,C6,'Room Reservation'!$J$2:$J$6000,D6,'Room Reservation'!$F$2:$F$6000,"<="&TODAY(),'Room Reservation'!$G$2:$G$6000,">="&TODAY()),"booking","no booking "))
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top